<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>templi php 框架: Model类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">templi php 框架
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>函数</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classModel-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">Model类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a39a87b4748dc7f5c7a70c95f0a9a427f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a39a87b4748dc7f5c7a70c95f0a9a427f">__construct</a> ($<a class="el" href="classModel.html#a3faeaf20245652160d32ec11c515dd00">table</a>='', $dbSign='master', $config=array())</td></tr>
<tr class="separator:a39a87b4748dc7f5c7a70c95f0a9a427f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a740f266bff6a614abd25c11530bdda3d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a740f266bff6a614abd25c11530bdda3d">__get</a> ($name)</td></tr>
<tr class="separator:a740f266bff6a614abd25c11530bdda3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6acfbb7d5648a4e0145c4a0c31fb61a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#ae6acfbb7d5648a4e0145c4a0c31fb61a">db</a> ($sign= 'master', $config=array())</td></tr>
<tr class="separator:ae6acfbb7d5648a4e0145c4a0c31fb61a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3faeaf20245652160d32ec11c515dd00"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a3faeaf20245652160d32ec11c515dd00">table</a> ($table)</td></tr>
<tr class="separator:a3faeaf20245652160d32ec11c515dd00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3e012a63c86588bfcd731b5a8c328a2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#ac3e012a63c86588bfcd731b5a8c328a2">field</a> ($field)</td></tr>
<tr class="separator:ac3e012a63c86588bfcd731b5a8c328a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5dd829d032889a927edcd3dbd6d47d9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a> ($where, $compare= '=')</td></tr>
<tr class="separator:af5dd829d032889a927edcd3dbd6d47d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd64e812e584a5c1df42c01fc55a759d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#afd64e812e584a5c1df42c01fc55a759d">where_or</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>, $compare= '=')</td></tr>
<tr class="separator:afd64e812e584a5c1df42c01fc55a759d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a091fcf8fdbf6f28db91268e7d5f73150"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a091fcf8fdbf6f28db91268e7d5f73150">set</a> (array $data)</td></tr>
<tr class="separator:a091fcf8fdbf6f28db91268e7d5f73150"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c3f0e0c0f25a9d2a86384ee69150563"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a8c3f0e0c0f25a9d2a86384ee69150563">order</a> ($order)</td></tr>
<tr class="separator:a8c3f0e0c0f25a9d2a86384ee69150563"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a369d8acc9579950dd85a1ce4aa577a99"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a369d8acc9579950dd85a1ce4aa577a99">limit</a> ($listNum, $offset=NULL)</td></tr>
<tr class="separator:a369d8acc9579950dd85a1ce4aa577a99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e8fb6b3b560fb611c6d12d2867d8da7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a8e8fb6b3b560fb611c6d12d2867d8da7">page</a> ($page)</td></tr>
<tr class="separator:a8e8fb6b3b560fb611c6d12d2867d8da7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab473f2922cd7060433e7c8413d919354"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#ab473f2922cd7060433e7c8413d919354">getlist</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>=NULL, $<a class="el" href="classModel.html#ac3e012a63c86588bfcd731b5a8c328a2">field</a>=NULL, $<a class="el" href="classModel.html#a8c3f0e0c0f25a9d2a86384ee69150563">order</a>=NULL, $current_page=NULL, $listNum=NULL, $pageNum=NULL, $urlrule=NULL, $maxpage=NULL)</td></tr>
<tr class="separator:ab473f2922cd7060433e7c8413d919354"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a844c2ee4faada5bbac578b62adae9cee"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a844c2ee4faada5bbac578b62adae9cee">select</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>=NULL, $<a class="el" href="classModel.html#ac3e012a63c86588bfcd731b5a8c328a2">field</a>=NULL, $<a class="el" href="classModel.html#a8c3f0e0c0f25a9d2a86384ee69150563">order</a>=NULL, $<a class="el" href="classModel.html#a369d8acc9579950dd85a1ce4aa577a99">limit</a>=NULL)</td></tr>
<tr class="separator:a844c2ee4faada5bbac578b62adae9cee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1487cf7bf91bd047da389d8655bffc15"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a1487cf7bf91bd047da389d8655bffc15">find</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>=NULL, $<a class="el" href="classModel.html#ac3e012a63c86588bfcd731b5a8c328a2">field</a>=NULL, $<a class="el" href="classModel.html#a8c3f0e0c0f25a9d2a86384ee69150563">order</a>=NULL)</td></tr>
<tr class="separator:a1487cf7bf91bd047da389d8655bffc15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcda663635b18fa1cbe2ff7be5f20857"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#abcda663635b18fa1cbe2ff7be5f20857">count</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>=NULL)</td></tr>
<tr class="separator:abcda663635b18fa1cbe2ff7be5f20857"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45aee351cf855db8628e446601f4d991"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a45aee351cf855db8628e446601f4d991">update</a> ($data=NULL, $<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>=NULL)</td></tr>
<tr class="separator:a45aee351cf855db8628e446601f4d991"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5534bd2589322bc8b47390e40f5a5543"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a5534bd2589322bc8b47390e40f5a5543">insert</a> ($data=NULL, $return_insert_id=false, $replace=false)</td></tr>
<tr class="separator:a5534bd2589322bc8b47390e40f5a5543"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa63b14eda9a9aca878b2d5f23c472a04"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#aa63b14eda9a9aca878b2d5f23c472a04">delete</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>=NULL)</td></tr>
<tr class="separator:aa63b14eda9a9aca878b2d5f23c472a04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af954d7753bc7f968ef9a73ce0c02bbb0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#af954d7753bc7f968ef9a73ce0c02bbb0">query</a> ($sql)</td></tr>
<tr class="separator:af954d7753bc7f968ef9a73ce0c02bbb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f8757ff982eba8da7250f1eb1b342d9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a8f8757ff982eba8da7250f1eb1b342d9">add_special_char</a> (&amp;$value)</td></tr>
<tr class="separator:a8f8757ff982eba8da7250f1eb1b342d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4eaa9ac649a682f8046a951bb4ade83"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#ab4eaa9ac649a682f8046a951bb4ade83">escape_string</a> (&amp;$value, $quotation=1)</td></tr>
<tr class="separator:ab4eaa9ac649a682f8046a951bb4ade83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ea8d45426e565fe134b5a6378642a68"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a8ea8d45426e565fe134b5a6378642a68">last_sql</a> ()</td></tr>
<tr class="separator:a8ea8d45426e565fe134b5a6378642a68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c05c472d8d3563583f335e8f3dd6d90"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a8c05c472d8d3563583f335e8f3dd6d90">sqls</a> ($<a class="el" href="classModel.html#af5dd829d032889a927edcd3dbd6d47d9">where</a>, $font= 'AND ', $compare= '=')</td></tr>
<tr class="separator:a8c05c472d8d3563583f335e8f3dd6d90"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a62f67587e29b2aa93736f38c97c56c65"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a62f67587e29b2aa93736f38c97c56c65"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>$table_name</b> =''</td></tr>
<tr class="separator:a62f67587e29b2aa93736f38c97c56c65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9dfaf85ba5f7f977cb537af1ce5b2b8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa9dfaf85ba5f7f977cb537af1ce5b2b8"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>$cache</b> = null</td></tr>
<tr class="separator:aa9dfaf85ba5f7f977cb537af1ce5b2b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a348093562fd01bcc977cc6659cf7b48f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a348093562fd01bcc977cc6659cf7b48f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>$db</b></td></tr>
<tr class="separator:a348093562fd01bcc977cc6659cf7b48f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>模型类 </p>
<dl class="section author"><dt>作者</dt><dd>七觞酒  <a href="#" onclick="location.href='mai'+'lto:'+'739'+'80'+'060'+'0@'+'qq.'+'co'+'m'; return false;">73980<span style="display: none;">.nosp@m.</span>0600<span style="display: none;">.nosp@m.</span>@qq.c<span style="display: none;">.nosp@m.</span>om</a> </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2013-3-20 </dd></dl>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="a39a87b4748dc7f5c7a70c95f0a9a427f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::__construct </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$table</em> = <code>''</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$dbSign</em> = <code>'master'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$config</em> = <code>array()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>构造函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$table</td><td>表名 </td></tr>
    <tr><td class="paramtype">int&#160;|&#160;string</td><td class="paramname">$dbSign</td><td>数据库唯一标识 </td></tr>
    <tr><td class="paramtype">array</td><td class="paramname">$config</td><td>数据库配置 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a740f266bff6a614abd25c11530bdda3d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::__get </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$name</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>获取当前模型 的配置信息 访问数据的的配置信息 数据库表前缀 表名等 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">$name</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>mixed </dd></dl>

</div>
</div>
<a class="anchor" id="a8f8757ff982eba8da7250f1eb1b342d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::add_special_char </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$value</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>对字段两边加反引号，以保证数据库安全 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">$value</td><td>数组值 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="abcda663635b18fa1cbe2ff7be5f20857"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::count </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em> = <code>NULL</code>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>查询数据条数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>or string 查询条件 可以是 数组 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae6acfbb7d5648a4e0145c4a0c31fb61a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::db </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$sign</em> = <code>'master'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$config</em> = <code>array()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置数据库连接 切换数据库 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">int&#160;|&#160;string</td><td class="paramname">$sign</td><td>数据库标识 </td></tr>
    <tr><td class="paramtype">array</td><td class="paramname">$config</td><td>数据库配置信息 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="aa63b14eda9a9aca878b2d5f23c472a04"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::delete </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em> = <code>NULL</code>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>删除数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>or array $where 条件 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="ab4eaa9ac649a682f8046a951bb4ade83"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::escape_string </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$quotation</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>对字段值两边加引号，以保证数据库安全 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">$value</td><td>数组值 </td></tr>
    <tr><td class="paramname">$quotation</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="ac3e012a63c86588bfcd731b5a8c328a2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::field </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$field</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>学则字段字段 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$field</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="a1487cf7bf91bd047da389d8655bffc15"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::find </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$field</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$order</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>单条查询 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">null</td><td class="paramname">$where</td><td></td></tr>
    <tr><td class="paramtype">null</td><td class="paramname">$field</td><td></td></tr>
    <tr><td class="paramtype">null</td><td class="paramname">$order</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab473f2922cd7060433e7c8413d919354"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::getlist </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$field</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$order</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$current_page</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$listNum</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$pageNum</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$urlrule</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$maxpage</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>多条查询并分页 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">null</td><td class="paramname">$where</td><td></td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$field</td><td>字段 </td></tr>
    <tr><td class="paramtype">null</td><td class="paramname">$order</td><td></td></tr>
    <tr><td class="paramtype">int</td><td class="paramname">$current_page</td><td>当前页 </td></tr>
    <tr><td class="paramtype">int</td><td class="paramname">$listNum</td><td>每页显示条数 </td></tr>
    <tr><td class="paramtype">int</td><td class="paramname">$pageNum</td><td>每页显示的 页码数 </td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$urlrule</td><td>url 规则 </td></tr>
    <tr><td class="paramtype"></td><td class="paramname">$maxpage</td><td>最多显示页数 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5534bd2589322bc8b47390e40f5a5543"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::insert </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$data</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$return_insert_id</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$replace</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>插入数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">array</td><td class="paramname">$data</td><td>要添加的数据 key 为字段名 value 为字段值 </td></tr>
    <tr><td class="paramtype">bool</td><td class="paramname">$return_insert_id</td><td>是否返回主键 号 </td></tr>
    <tr><td class="paramtype">bool</td><td class="paramname">$replace</td><td>是否 为替换插入 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="a8ea8d45426e565fe134b5a6378642a68"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::last_sql </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>获取最后一次执行的sql 语句 </p>

</div>
</div>
<a class="anchor" id="a369d8acc9579950dd85a1ce4aa577a99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::limit </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$listNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$offset</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>limit </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype"></td><td class="paramname">$listNum</td><td></td></tr>
    <tr><td class="paramtype">null</td><td class="paramname">$offset</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="a8c3f0e0c0f25a9d2a86384ee69150563"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::order </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$order</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>oder by </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$order</td><td>example id desc </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="a8e8fb6b3b560fb611c6d12d2867d8da7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::page </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$page</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>分页设置 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">array</td><td class="paramname">$page</td><td>$page['total'] 总数 $page['listNum'] 每页显示条数 $page['current_page'] 当前页 $page['pageNum'] 每页显示的 页码数 $page['urlrule'] 分页 url 规则 $page['maxpage'] 最大页数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="af954d7753bc7f968ef9a73ce0c02bbb0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::query </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$sql</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>执行基本的 mysql查询 </p>

</div>
</div>
<a class="anchor" id="a844c2ee4faada5bbac578b62adae9cee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::select </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$field</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$order</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$limit</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>多条查询 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">null</td><td class="paramname">$where</td><td></td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$field</td><td>字段 </td></tr>
    <tr><td class="paramtype">null</td><td class="paramname">$order</td><td></td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$limit</td><td>条数限制 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a091fcf8fdbf6f28db91268e7d5f73150"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::set </td>
          <td>(</td>
          <td class="paramtype">array&#160;</td>
          <td class="paramname"><em>$data</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>给 update insert 赋值 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">array</td><td class="paramname">$data</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classAbnormal.html">Abnormal</a></td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="a8c05c472d8d3563583f335e8f3dd6d90"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Model::sqls </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$font</em> = <code>'&#160;AND&#160;'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$compare</em> = <code>'='</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>将数组转换为SQL语句 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">array</td><td class="paramname">$where</td><td>要生成的数组 </td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$font</td><td>连接串 </td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$compare</td><td>比较字符 (=,!=,in not in, like) </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classAbnormal.html">Abnormal</a></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3faeaf20245652160d32ec11c515dd00"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::table </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$table</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置操作数据表 此方法不建议使用 （使用 此方法 会改变 之前模型 的操作表） </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$table</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="a45aee351cf855db8628e446601f4d991"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::update </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$data</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>修改数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>or string $data要修改的数据 字符串为 sql 语句 数组key 为字段名 value 为字段值 </td></tr>
    <tr><td class="paramname">array</td><td>or string $where 条件语句 可为数组</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="af5dd829d032889a927edcd3dbd6d47d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::where </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$compare</em> = <code>'='</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>where 条件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype"></td><td class="paramname">array</td><td>or string $where</td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$compare</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<a class="anchor" id="afd64e812e584a5c1df42c01fc55a759d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Model::where_or </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$where</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$compare</em> = <code>'='</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>where 条件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype"></td><td class="paramname">array</td><td>or string $where </td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$compare</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>$this </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>templi/Model.class.php</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2014年 一月 15日 星期三 15:42:01 , 为 templi php 框架使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
